@let poHelper = setHelper(label, additionalHelpTooltip);
<po-field-container
  [p-label]="label"
  [p-optional]="optional"
  [p-required]="required"
  [p-show-required]="showRequired"
  [p-helper]="label ? poHelper.helperSettings : undefined"
  [p-show-helper]="label ? displayAdditionalHelp : undefined"
  [p-size]="size"
  [p-text-wrap]="labelTextWrap()"
>
  <div class="po-field-container-content" [attr.p-size]="size">
    <po-rich-text-body
      #richTextBody
      [p-height]="height"
      [p-label]="label"
      [p-model-value]="value"
      [p-placeholder]="placeholder"
      [p-readonly]="readonly"
      [p-size]="size"
      (p-change)="onChangeValue($event)"
      (p-commands)="richTextToolbar?.setButtonsStates($event)"
      (p-selected-link)="richTextToolbar?.selectedLink($event)"
      (p-shortcut-command)="richTextToolbar?.shortcutTrigger()"
      (p-value)="updateValue($event)"
      (p-blur)="onBlur()"
      (p-keydown)="onKeyDown($event)"
    >
    </po-rich-text-body>

    @if (!isAllActionsHidden()) {
      <po-rich-text-toolbar
        #richTextToolbar
        [p-readonly]="readonly"
        [p-hide-toolbar-actions]="toolbarActions"
        [p-size]="size"
        (p-link-editing)="richTextBody.linkEditing($event)"
        (p-command)="richTextBody.executeCommand($event)"
      >
      </po-rich-text-toolbar>
    }
  </div>
  @if (!readonly) {
    <po-field-container-bottom
      [p-append-in-body]="appendBox"
      [p-help]="help"
      [p-error-limit]="errorLimit"
      [p-error-pattern]="errorMsg"
      [p-size]="size"
      [p-helper]="!label ? poHelper.helperSettings : undefined"
      [p-show-helper]="!label ? displayAdditionalHelp : undefined"
    ></po-field-container-bottom>
  }
</po-field-container>
